<?php
/**
 * index.php
 * @author ranuandra
 *
 * 11 Agu 2011 08:45:35
 *
 * 
 */
$bulanlist = array(
	'01'=>'Januari',
	'02'=>'Februari',
	'03'=>'Maret',
	'04'=>'April',
	'05'=>'Mei',
	'06'=>'Juni',
	'07'=>'Juli',
	'08'=>'Agustus',
	'09'=>'September',
	'10'=>'Oktober',
	'11'=>'November',
	'12'=>'Desember'
	);
	
$thn = date("Y");
//echo $thn;
$tahunlist = array();
for($i=$thn; $i>=1990; $i--)
{
	$tahunlist[$i] = $i;
}
			
	         if(isset($message))
	         {
	         	echo "<div class=\"error\">$message</div>";
	         }
?>
	<table class="tbltitle" align="center">
	<thead>
		<tr>
			<td class="title">
				<?php 
				if(isset($title))
				{
					echo $title;	
				}
				?>
			</td>
			<td class="toolbar">
				<div class="toolbar-icon">	
					<ul>
						<li><a href="<?php echo URL::base()?>upload/new" class="clsform"><span class="icon-32-upload"></span>Upload</a></li>
					</ul>
					
					
				</div> 
			</td>
		</tr>
	</thead>
	</table>
<div class="tbl-top">
	<div>
<?php 
	echo Form::open(URL::base().'upload');
	echo "<span>Periode : </span>";
	echo Form::select('bulan', $bulanlist, $form['bulan']).' - ';
	echo Form::select('tahun', $tahunlist, $form['tahun']);
	echo Form::submit('submit', 'Cari');
	echo  Form::close();
?>
	</div>
</div>
<div class="tbldata">
<table class="data" class="center">
	<thead>
		<tr>
			<th>ID</th>
			<th>File Name</th>
			<th>Tgl Upload</th>
			<th>Action</th>
			<th>Periode</th>
		</tr>
	<thead>
	<tbody>
<?php 
if(isset($datas))
{
	foreach($datas as $data)
	{
?>
		<tr>
			<td><?php echo $data['id']?></td>
			<td><?php echo $data['fname']?></td>
			<td><?php echo $data['tgl_upload']?></td>
			<td><?php echo $bulan[$data['bulan']].' - '.$data['tahun']?></td>
			<td>
				<table>
					<tr>
						<td class="action"><a href="<?php echo URL::base()?>upload/delete/<?php echo $data['id']?>"><span class="icon_delete_16"></span>Hapus</a></td></td>
					</tr>
				</table>
				
				
			</td>
		</tr>
<?php 		
	}
}
?>
	</tbody>
</table>
</div>
